<template>
	<view  style="padding-top: 108rpx;">
		<navbar :title="$t('pay.topupwebtitle')" background="#ffffff">
		</navbar>
		<web-view class="webview" :webview-styles="webviewStyles" :src="url" ></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				webviewStyles: {
					progress: {
						color: '#2972FF'
					}
				},
                url: ''
			}
		},
        onLoad(val) {
			// #ifdef APP-PLUS
			let that = this;
			uni.getSystemInfo({
			//成功获取的回调函数，返回值为系统信息
			success: (sysinfo) => {
				console.log(sysinfo);
				var height=0;
				height = sysinfo.windowHeight-uni.upx2px(158);//⾃⾏修改，⾃⼰需要的⾼度
				console.log(height);
				var currentWebview = that.$scope.$getAppWebview();//获取当前web-view
				setTimeout(function() {
				var wv = currentWebview.children()[0];
				console.log(wv);
				wv.setStyle({//设置web-view距离顶部的距离以及⾃⼰的⾼度，单位为px
					top: uni.upx2px(158),
					height: height
				})
				}, 500);//如页⾯初始化调⽤需要写延迟
			},
			complete: () => {
			}
			});
			// #endif

			// #ifndef APP-PLUS
			// #endif
            if (val.imurl) {
                this.url = decodeURIComponent(val.imurl);
            }
        },
        methods: {
            handleBack() {
				console.log(123)
				uni.navigateTo({
					url: '../account/account'
				})
			},
        }
	}
</script>

<style>
	.webview {
		top: 108rpx;
		height: calc(100vh - 108rpx);
	}
</style>